#include <iostream>
#include <vector>
using namespace std;

void GetMarksNo( vector<int> vMarks, int iAimMarks )
{
	int ilen = vMarks.size();
	int icount = 0;
	for (int i=0; i<ilen; i++)
	{
		if (vMarks[i] == iAimMarks)
		{
			icount++;
		}
	}

	cout<<icount<<endl;
}

int main()
{
	int iPersonNo;
	int iMarks;
	vector<int> vMarks;
	int iAimMarks;
	while (cin>>iPersonNo)
	{
		if (iPersonNo == 0)
		{
			return 0;
		}

		if (iPersonNo<0 || iPersonNo>1000)
		{
			return 0;
		}

		for (int i=0; i<iPersonNo; i++)
		{
			cin>>iMarks;
			if (iMarks<0 || iMarks>100)
			{
				return 0;
			}
			vMarks.push_back(iMarks);
		}

		cin>>iAimMarks;

		GetMarksNo(vMarks,iAimMarks);
	}
	return 1;
}